package com.shujia;

import java.io.IOException;
import java.io.Serializable;
import java.net.ServerSocket;
import java.net.Socket;

public class Test {
    public static void main(String[] args) throws IOException {


        //新生状态，无资格无资源
        Task task = new Task();


        //启动线程
        //就绪状态，有资格，无资源
        //运行状态，有资格，有资源
        task.start();

        //阻塞状态，无资格，无资源


        //死亡状态。


        ServerSocket serverSocket = new ServerSocket(8888);

        Socket accept = serverSocket.accept();


        Socket localhost = new Socket("localhost", 8888);

    }
}


class Task extends Thread implements Serializable {
    @Override
    public void run() {


        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}